/**
 * ***********************************************************************
 * Copyright:2016-2018 DongLBS Inc. All rights reserved.
 * Author:Riven
 * CreateData:2017-06-02 11:48
 * Version:v0.0.8
 * Description:注册页面
 * ***********************************************************************
 */
<template>
  <f7-page>
    <f7-navbar :title="$t('register.title')" :back-link="$t('common.back')" sliding></f7-navbar>
    <f7-block-title>{{$t("common.information")}}</f7-block-title>
    <f7-list form>
      <f7-list-item>
        <f7-label>{{$t("app.account")}}</f7-label>
        <f7-input type="text" :placeholder="$t('app.account')" :value="user.account" @input="user.account = $event.target.value"></f7-input>
      </f7-list-item>
      <f7-list-item>
        <f7-label>{{$t("app.password")}}</f7-label>
        <f7-input type="text" :placeholder="$t('app.password')" :value="user.password" @input="user.password = $event.target.value"></f7-input>
      </f7-list-item>
      <f7-list-item>
        <f7-label>{{$t("register.confirmPassword")}}</f7-label>
        <f7-input type="text" :placeholder="$t('register.enterPasswordsAgain')" :value="user.password2" @input="user.password2 = $event.target.value"></f7-input>
      </f7-list-item>


    </f7-list>

    <f7-block>
      <f7-row tag="p">
        <f7-button class="col"  fill raised color="blue" @click="register">{{$t("app.register")}}</f7-button>

      </f7-row>
    </f7-block>
  </f7-page>
</template>

<script>
import { register } from '@/api/api';
export default {
  data() {
			return {
				user:{
          account:'',
          password:'',
          password2:'',
          roleIds:[1]
        }
			}
		},
  methods:{
    register(){
        register(this.user).then(data => {
          this.$f7.dialog.alert('注册成功!');
          this.$f7.views.login.router.back();
        });
    },
  },
  mounted() {
		}
}
</script>
